<?php
    function __autoload($classname) {
        $filename = "../classes/". $classname .".php";
        require_once($filename);
    }
    
    require('../config/config.php');
    $db = new Db();
    Db::Execute('SET NAMES UTF8');
    if((!isset($_SESSION['employe']) || empty($_SESSION['employe'])) && $_SERVER['SCRIPT_NAME'] != __BASE_URI__.'admin8976/connexion.php') {
        Tools::redirect('connexion.php');
    }
    else if($_SERVER['SCRIPT_NAME'] == __BASE_URI__.'admin8976/connexion.php' && isset($_SESSION['employe']) 
                && $_SESSION['employe'] instanceof Employe) {
        Tools::redirect('index.php');
    }
?>
